<?php

namespace app\admin\model\vppz;

use think\Model;
use traits\model\SoftDelete;

class Keshi extends Model
{

    use SoftDelete;



    // 表名
    protected $name = 'yyks';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [
        'type_text',
        'image_url'
    ];

public function gettypeList()
    {
        return ['1'=>'本地医疗','2'=>'其他医疗'];
    }
    public function getTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_local']) ? $data['is_local'] : '1');
        $list = $this->gettypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }

	// 获取器直接转换url
	public function getImageUrlAttr($value,$data)
    {
        return \addons\vppz\library\Vpower::dourl($data['image']);
    }
}
